<%@page import="fu.abc.DAO.LocationDAO"%>
<%@page import="java.util.ArrayList"%>
<%@page import="fu.abc.model.Location"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link href="css/style.css" media="screen" rel="stylesheet" type="text/css" />
	<link href="css/result.css" media="screen" rel="stylesheet" type="text/css" />
	<link type="text/css" rel="stylesheet" href="./end-user/simplePagination.css"/>
	<link href="./end-user/css/style.css" media="screen" rel="stylesheet" type="text/css" />
	<link href="./end-user/css/result.css" media="screen" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
	<script type="text/javascript" src="./end-user/js/jquery.shorten.1.0.js"></script>
	<script type="text/javascript" src="./end-user/js/jquery.js"></script>
	<script type="text/javascript" src="./end-user/js/jquery.simplePagination.js"></script>
	
	<title>Vnplace.vn</title>
		<style type="text/css">
			#content-between{
				width: 1070px;
			}
			a {
				    color: #0254EB
				}
				a:visited {
				    color: #0254EB
				}
				a.morelink {
				    text-decoration:none;
				    outline: none;
				}
				.morecontent span {
				    display: none;
				}
		
        </style>

	<script>
	$(document).ready(function(){
	
		// hide #back-top first
		$("#back-top").hide();
		
		// fade in #back-top
		$(function () {
			$(window).scroll(function () {
				if ($(this).scrollTop() > 100) {
					$('#back-top').fadeIn();
				} else {
					$('#back-top').fadeOut();
				}
			});
	
			// scroll body to 0px on click
			$('#back-top a').click(function () {
				$('body,html').animate({
					scrollTop: 0
				}, 800);
				return false;
			});
		});
	
	});
	</script>
	</head>
<body>
	<div id="wrap-container">
		<div id="header-menu">
			<form action="/Vnplace/SearchLocation" method="post">
			<ul id="top-menu">
				<li class="li-brand"><a href="/Vnplace/end-user/homepage.jsp"><img alt=""
						src="end-user/image/logo.jpg" width="90px" height="80px;"></a></li>
				
				<li><select class="province" name="province">
						<option value="null" selected="selected">----- Tỉnh -----</option>
						<option value="1">An Giang</option>
						<option value="2">B&#224; Rịa Vũng T&#224;u</option>
						<option value="3">Bắc Giang</option>
						<option value="4">Bắc Kạn</option>
						<option value="5">Bạc Li&#234;u</option>
						<option value="6">Bắc Ninh</option>
						<option value="7">Bến Tre</option>
						<option value="8">B&#236;nh Định</option>
						<option value="9">B&#236;nh Dương</option>
						<option value="10">B&#236;nh Phước</option>
						<option value="11">B&#236;nh Thuận</option>
						<option value="12">C&#224; Mau</option>
						<option value="13">Cần Thơ</option>
						<option value="14">Cao Bằng</option>
						<option value="15">Đ&#224; Nẵng</option>
						<option value="16">Đắk Lắk</option>
						<option value="17">Đăk N&#244;ng</option>
						<option value="18">Điện Bi&#234;n</option>
						<option value="19">Đồng Nai</option>
						<option value="20">Đồng Th&#225;p</option>
						<option value="21">Gia Lai</option>
						<option value="22">H&#224; Giang</option>
						<option value="23">H&#224; Nam</option>
						<option value="24">H&#224; Nội</option>
						<option value="25">H&#224; Tĩnh</option>
						<option value="26">Hải Dương</option>
						<option value="27">Hải Ph&#242;ng</option>
						<option value="28">Hậu Giang</option>
						<option value="29">H&#242;a B&#236;nh</option>
						<option value="30">Hưng Y&#234;n</option>
						<option value="31">Kh&#225;nh H&#242;a</option>
						<option value="32">Ki&#234;n Giang</option>
						<option value="33">Kon Tum</option>
						<option value="34">Lai Ch&#226;u</option>
						<option value="35">L&#226;m Đồng</option>
						<option value="36">Lạng Sơn</option>
						<option value="37">L&#224;o Cai</option>
						<option value="38">Long An</option>
						<option value="39">Nam Định</option>
						<option value="40">Nghệ An</option>
						<option value="41">Ninh B&#236;nh</option>
						<option value="42">Ninh Thuận</option>
						<option value="43">Ph&#250; Thọ</option>
						<option value="44">Ph&#250; Y&#234;n</option>
						<option value="45">Quảng B&#236;nh</option>
						<option value="46">Quảng Nam</option>
						<option value="47">Quảng Ng&#227;i</option>
						<option value="48">Quảng Ninh</option>
						<option value="49">Quảng Trị</option>
						<option value="50">S&#243;c Trăng</option>
						<option value="51">Sơn La</option>
						<option value="52">T&#226;y Ninh</option>
						<option value="53">Th&#225;i B&#236;nh</option>
						<option value="54">Th&#225;i Nguy&#234;n</option>
						<option value="55">Thanh H&#243;a</option>
						<option value="56">Th&#224;nh Phố Hồ Ch&#237; Minh</option>
						<option value="57">Thừa Thi&#234;n Huế</option>
						<option value="58">Tiền Giang</option>
						<option value="59">Tr&#224; Vinh</option>
						<option value="60">Tuy&#234;n Quang</option>
						<option value="61">Vĩnh Long</option>
						<option value="62">Vĩnh Ph&#250;c</option>
						<option value="63">Y&#234;n B&#225;i</option>
				</select></li>
				<li class="li-search">
						<input name="txtsearch" class="txt-search" type="text" placeholder="       Nhập địa điểm cần tìm kiếm...">
						<input type="submit" class="btn" value="Tìm kiếm" />
				</li>
				<li class="li-add"><img src="end-user/image/add.png" width="25" height="25"></li>
				<li class="li-2"><a href="/Vnplace/end-user/createlocal.jsp">Tạo địa điểm</a></li>
				<li class="li-3"><a href="/Vnplace/end-user/introduce.jsp">Giới thiệu</a></li>
				<li class="li-4"><a href="/Vnplace/end-user/contact.jsp">Liên hệ</a></li>
			</ul>
			</form>
		</div>
		
		<div id="content">
			<div id="left"></div>
<!-- 			end left -->
			<div id="content-between">
				<div id="content-result">
<!-- 					<fieldset> -->

						<div id="advertise">
							<a href="http://news.zing.vn/diem-thi-dai-hoc-cao-dang-2014/#homepage" target="_blank">
							<img alt="" src="./end-user/image/adver.png" width="760px" style="margin-top: 10px;"></a>
						</div>
						<div id="result">
							<b class="b-result">Có
							<%
								Object ab = request.getAttribute("list");
								if(ab!=null){
									List<Location> list = (ArrayList<Location>) ab;
									int i = 1;
									int count=1;
									int dem = 0;
									for (Location a : list) {
										dem = count++ ;
									} %>
							
							 <%= dem %> kết quả được tìm thấy</b>
						</div>

<!-- 						result for search -->
						<div id="main-result" class="comment">
							<%
									for(Location a: list){
								
							%>
							<div class="place-item">
								<div class="place-avatar">
									<a href="" ><img src="./end-user/image/Noimage.jpg" width="120px" height="120px"></a>
								</div>
								<ul class="place-info">
									<li><a class="place-title" href="./end-user/inforlocal.jsp?id=<%=a.getIdNewLocal()%>"> <b><%=a.getLocationName() %></b></a></li>
									<li><span class="address-details"><b>Tỉnh/thành phố: </b><%=a.getProvince() %></span></li>
									<li><span class="address-details"><b>Địa chỉ: </b><%=a.getAddressDetail() %></span></li>
									<li><span class="category"><b>Nhóm địa điểm: </b><%=a.getCategory() %></span><li>
								</ul>
								<div class="clear"></div>
							</div>
							<%}
							}%>
						</div>
<!-- 						 end main result searching -->

						<div>
						  <div>
	                            <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"> </script>
	                            <ins class="adsbygoogle"
	                                 style="display: inline-block; width: 760px; height: 100px"
	                                 data-ad-client="ca-pub-1704544291315733"
	                                 data-ad-slot="4720331006"></ins>
	                            <script>
	                                (adsbygoogle = window.adsbygoogle || []).push({ });
	                            </script>
	                        </div>
	               		</div>
<!-- 					</fieldset>      	 -->
				</div>


				<div id="new-location">
					<div id="av">
						<a href="http://www.samsung.com/vn/" target="_blank"><img alt="" src="./end-user/image/av.png" width="290px" class="aver"> </a>
					</div>
					<div id="local-relate">
						<b class="title">Địa điểm mới</b>
					</div>
					<div id="local">
					<%
						List<Location> local = new ArrayList();
						LocationDAO localdao = new LocationDAO();
						local = localdao.listNewLocation();
						for(Location a: local){
					%>
						<div id="local-detail">
							<a href="/Vnplace/end-user/inforlocal.jsp?id=<%=a.getIdNewLocal() %>" class="a-local"><%=a.getLocationName() %></a>
						</div>
					<%} %>
					</div>
				</div>
			</div> 
	<!-- 				end content-result -->
			<p id="back-top">
				<a href="#top"><span></span></a>
			</p>
		</div><!-- 			end content -->
		<div id="footer">
			<ul id="footer-menu">
				<li><a href="/Vnplace/end-user/homepage.jsp">Trang chủ</a></li>
				<li><a href="/Vnplace/end-user/createlocal.jsp">Tạo địa điểm mới</a></li>
				<li><a href="/Vnplace/end-user/introduce.jsp">Giới thiệu</a></li>
				<li><a href="/Vnplace/end-user/contact.jsp" class="li-3">Liên hệ</a></li>
			</ul>
			<p class="copyright">©Copyright 2014 VnPlace.vn</p>
		</div>
		
	</div>
</body>
</html>